import java.util.Scanner;

public class homework47 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入鸡和兔的总数量：");
        int n = scanner.nextInt();
        System.out.println("请输入鸡和兔的总腿数：");
        int m = scanner.nextInt();
        jitu(n, m);
    }

    public static void jitu(int n, int m) {
        int count = 1;//鸡
        for (count = 1; count < n; count++) {
            if ((count * 2 + (n - count) * 4) == m) {
                System.out.println(count);
                System.out.println(n - count);
            } else {
                System.out.println("NO answer");
            }
        }
    }
}
























































































































































































































































































